<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.kylin.module.shop.orm.*,
                 com.kylin.common.util.*,
				 com.kylin.common.dict.orm.Dict,
                 com.kylin.common.paginate.DisplayPage,
				 com.kylin.module.user.orm.*" %>
<%@ include file="../_deco/managetop.jsp"%>

<br>
<table class="tl050804" cellspacing="0" cellpadding="0">
  <tr>
    <td width="280"  align="center" valign="top">
			<%@ include file="../_deco/manageLeft.jsp"%>
		</td>
		<td align="left" valign="top">
<%
////////////////////右侧 内容区  /////////////////////// start
%>		
<table width="92%" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" class="ms02">&nbsp;&nbsp;<bean:message key="company.35"/></td>
        <td align="right">欢迎</td>
      </tr>
	   <tr>
              <td colspan="2" bgcolor="CDCDCD" height="1"></td>
             
	   </tr>
    </table>

<mytag:MyActionMsg />
 
      <br>
      <table  class="comp09" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td ><table  class="comp08" cellpadding="0" cellspacing="0">
              <tr>
                <td><a href="#" onclick="toDB()" class="pros"><bean:message key="company.37"/></a></td>
              </tr>
          </table></td>
        </tr>
      </table>
<script>
   function toEdit(id){
       document.fo1.CMD.value="bfUpdate";
       document.fo1.id.value=id;
       document.fo1.submit();
  }
 
   function toDB(){
       document.fo1.CMD.value="toProductsDB";
       document.fo1.submit();
   }
   
</script>
<form name="fo1" action="/module/shop/company/manageProduct.do" method="post">
<input type="hidden" name="CMD"/>
<input type="hidden" name="id" />
      <table  cellpadding="0" cellspacing="0" class="comp07" align="center">
        <tr>
          <td class="comp0701"><bean:message key="company.81"/></td>
        </tr>
<%
  String ownUrl ="/module/shop/company/companyManage.do?CMD=manage4";
  if(request.getAttribute(Constants.KEY_REQUEST_RESULT   )!=null){
     DisplayPage dispage = (DisplayPage)request.getAttribute(Constants.KEY_REQUEST_RESULT);
     out.println("<input type='hidden' name='searchId' value='"+dispage.getSearchId()+"' />");
     out.println("<input type='hidden' name='page' value='"+dispage.getPageNumber()+"' />");
     ownUrl += "&searchId=" + dispage.getSearchId();
     ownUrl += "&page=" + dispage.getPageNumber();
     for(int i=0;i<dispage.getList().size();i++){
    	Product p = (Product)dispage.getList().get(i);
%>
        <tr>
          <td align="left"  class="comp04td"><table cellpadding="0" cellspacing="0">
              <tr>
                <td rowspan="2"><img src="/fileOutServlet?imgType=<%=Constants.IMG_PRODUCT %>&imgurl=<%=p.getImgurl() %>" 
						    width="80" height="80">
				</td>
                <td>
						<input type="checkbox" name="ids" value="<%=p.getId()%>">
						<span class="compn"><%=p.getName() %></span>
						<br>
						   <%=JspHelper.checkNull(p.getIntroduce()) %>&nbsp; 
                </td>
              </tr>
              <tr>
                <td align="right">
 						<input type="button" onclick="toEdit('<%=p.getId() %>')" value="<bean:message key="base.58"/>">
                </td>
              </tr>
          </table></td>
        </tr>

	<%} %>

        </table>
</form>    
<%
     //调用共通方法生成翻页工具条
	 out.print(JspHelper.getPageBar(dispage,ownUrl));
  } 
%>

<%
////////////////////右侧 内容区  /////////////////////// end
%>		
		</td>
	</tr>
</table>

        